package spec.dengyuru.unit3.task3_1;

public class FinanceInfo {
    private String companyName;
    private double earnestIncome;
    private double depositIncome;
    private double rentIncome;
    private double otherIncome;
    private double staffCost;
    private double rentCost;
    private double hydropowerCost;
    private double taxCost;
    private double otherCost;
    //以下为getXXX和getXXX方法
    public String getComepanyName(){
        return companyName;
    }
    public void setComepanyName(String companyName){
        this.companyName=companyName;
    }
    public double getEarnestIncome(){
        return earnestIncome;
    }
    public void setEarnestIncome(double earnestIncome) {
        this.earnestIncome = earnestIncome;
    }
    public double getDepositIncome(){
        return depositIncome;
    }
    public void setdepositIncome(double depositIncome){
        this.depositIncome=depositIncome;
    }
    public double getRentIncome(){
        return rentIncome;
    }
    public void setRentIncome(double rentIncome){
        this.rentIncome= rentIncome;
    }
    public double getOtherIncome(){
        return otherIncome;
    }
    public void setOtherIncome(double otherIncome){
        this.otherIncome=otherIncome;
    }
    public double getStaffCost(){
        return staffCost;
    }
    public void setStaffCost(double StaffCost){
        this.staffCost=StaffCost;
    }
    public double getRentCost(){
        return rentCost;
    }
    public void setRentCost(double RentCost){
        this.rentCost =RentCost;
    }
    public double getHydropowerCost(){
        return hydropowerCost;
    }
    public void setHydropowerCost(double HydropowerCost){
        this.hydropowerCost=hydropowerCost;
    }
    public double getTaxCost(){
        return taxCost;
    }
    public void setTaxCost(double TaxCost){
        this.taxCost=TaxCost;
    }
    public double OtherCost(){
        return otherCost;
    }
    public void setOtherCost(double OtherCost){
        this.otherCost=OtherCost;
    }
    //收入计算
    public double calIncome(){
        double sumIncome=earnestIncome +depositIncome +rentIncome +otherIncome;
        return sumIncome;
    }
    //成本计算
    public double calCost(){
        double sumCost=staffCost+rentCost+hydropowerCost+taxCost+otherCost;
        return sumCost;
    }
    //净收入计算
    public double calNetIncome(){
        System.out.println(companyName+"的净收入计算结果：" );
        double netIncome=calIncome()-calCost();
        return netIncome;
    }
}

